<?php

class Flight_Controller_Frontend_Index {

    /**
     * execute
     * 执行分发的action
     *
     * @return void
     */
    public function execute() {

        $front = Controller_Front::getInstance();
        $actionName = $front->getMethod();

        $actionClassName = get_class($this) . '_' . ucwords($actionName);

        if(class_exists($actionClassName)) {
            $action = new $actionClassName();
            if ($action->_beforeAction($actionName)) {
                $action->execute();
            }
        } else {
            echo '不存在';
        }
    }
}